<?php
function doc_set_lang_dir() {
	$locale = apply_filters('plugin_locale', get_locale(), DOCUMENTS_DOMAIN);	
	load_textdomain(DOCUMENTS_DOMAIN, WP_LANG_DIR.'/'.DOCUMENTS_DOMAIN.'/'.DOCUMENTS_DOMAIN.'-'.$locale.'.mo');
	load_plugin_textdomain(DOCUMENTS_DOMAIN, FALSE, dirname(plugin_basename(__FILE__)).'/languages/');
}



function doc_get_current_user() {
	// Insert pluggable.php before calling get_currentuserinfo()
	require (ABSPATH . WPINC . '/pluggable.php');
	global $current_user;
	get_currentuserinfo();
	return $current_user;
}



function doc_no_permissions() {	
	$msg = "<p>" . __( 'Sorry, you have not permissions for this page', DOCUMENTS_DOMAIN ) . "</p>";	
	return $msg;
}